1. Field of the Invention
The present invention relates to a technique to compress or decode, for example, musical performance information, particularly to a musical performance information compression apparatus for efficiently compressing a data amount of musical performance information, a musical performance information decoding apparatus, a musical performance information compression program product, and musical performance information decoding program product.
2. Description of the Related Art
In general, musical instrument digital interface (MIDI) standards have heretofore been known as standards concerning an interface for digital communication of musical performance information, for example, from musical instruments and the like. Moreover, in general, for example, a standard MIDI file (hereinafter referred to as SMF) has been known as a file to store data defined in the MIDI standards, and has already generally been used in various fields.
In this SMF, each musical performance information is represented by an MIDI message constituted by combination of several characters of one byte, a status of one byte of the MIDI message is defined by the MIDI standards, and the musical performance information is accordingly distinguished. Furthermore, status bytes are followed by data bytes, and the number of the data bytes differs with the type of the musical performance information.
It is to be noted that the status byte additionally includes the type of the status, and information of a channel number.
Therefore, today, considering from a comparatively large file size of the SMF, it has been demanded that a data amount of each musical performance information included in this SMF is efficiently compressed in a case where the SMF is applied to a system or the like for recording and transmitting a large number of musical data, and technical development has been advanced for the compression.
Here, as a reversible coding method which is a coding method for decoding coded information to completely match the information with original information, for example, a Lempel-Zif (LZ) coding method, a Huffman coding method, a run length coding method, and further a composite system (e.g., LHA, ZIP, etc.) of them have been generally known and used.
Among them, first, in the LZ system, repeated data is compressed utilizing repetition of data patterns. Therefore, when the number of the same data patterns appears in a predetermined range in input data, there is a characteristic that compression ratio drops. Here, compression ratio refers to a ratio of a size of compressed data to that of the data before compression. Moreover, when the compression ratio drops, it is meant that compression efficiency becomes higher (better).
Further in the Huffman coding system, a predetermined tree weighted by appearance frequency of codes of each byte is constituted regardless of the data pattern, the data is coded in such a manner that the data can be recorded concerning the code having more weight with a small number of bits, and therefore the system is effective for the data having bias in appearance frequency of the codes of each byte.
Moreover, the LHA coding system in which these LZ and Huffman coding systems are combined has advantages of the LZ and Huffman coding systems.
Here, in the SMF, each musical performance information is constituted of delta time (hereinafter referred to as Δtime) and event, and further each event includes information such as a note-on or note-off status, musical pitch, loudness and the like.
In general, the musical piece is frequently constituted of repetition of similar phrases, but a musical producer sometimes subtly changes, for example, sound loudness or length in order to prevent a musical piece from being monotonous. Even when phrases having the same pattern exist in different channels, but when the event of the musical performance information of the SMF includes information concerning a channel number, recording data has a different pattern.
In this manner, in the SMF, the data is compressed by a general-purpose compression system due to the above-described situations caused when a plurality of pieces of information are included in an event which is a minimum unit of data recording, and in this case the system is further devised in order to raise the compression efficiency.
In consideration of this respect, for example, in Jpn. Pat. Appln. KOKAI Publication No. 9-16168, techniques concerning a musical performance information compression apparatus and a musical performance information decoding apparatus have been described in which the musical performance information is separated into information of pitch, information of loudness, information of length, and other information by primary code production means, each information is disposed in an independent region, and accordingly the compression efficiency by the subsequent LZ system is raised.
However, in the technique described in the Jpn. Pat. Appln. KOKAI Publication No. 9-16168, although each musical performance information is dependent in time at a primary coding time, information on an order of each musical performance information is not stored, and therefore the order of each musical performance information sometimes changes in a case where the coded musical performance information is decoded. That is, the decoded musical performance information does not completely match the original musical performance information in some case.